
module.exports = function(mysql,params=null){
    const mysql = require('mysql');
    const conn = mql.createConnection({
         host:"localhost",
         user:'root',
         port:'3007',
         password:'0000',
         database:'bigevent'
    });
    conn.connect()
    return new promise((resolve,reject)=>{
        conn.query(mysql,params,(err,result)=>{
        err ? reject(err) : resolve(result);
        }).catch(err=>{
            console.log(err.mql);
        })
       conn.end(err.message);
    })  
}
